﻿<script id="tabularItemsTemplate" type="text/template">    
    @Html.Partial("Item/_TabularFilter")
    <table class="table table-hover table-condensed ">
        <thead>
            <tr>
                <th ng-repeat="currentColumn in columnsList" ng-bind="currentColumn">
                </th>                
                <th scope="col" class="text-right">
                    <button class="btn btn-default" ng-click="toggleFilter()" ng-class="{'btn-primary' : isFilterVisible == true}" title="Filter" ><span class="glyphicon glyphicon-filter"></span></button>
                </th>
            </tr>
        </thead>
        <tbody>
            <tr ng-repeat="item in list" ng-mouseenter="activate($index)" ng-mouseleave="deactivate($index)" >
                <td ng-repeat="currentColumn in columnsList" ng-bind-html="item[currentColumn] | linky:'_blank' " ></td>
                
                <td class="text-right">
                    <span ng-show="$index!=activeIndex">
                        <button class="btn btn-default" style="visibility:hidden"><span class="glyphicon glyphicon-edit"></span></button>
                        <button class="btn btn-default" style="visibility:hidden"><span class="glyphicon glyphicon-remove"></span></button>
                    </span>
                    <span ng-show="$index==activeIndex">
                        <button ng-click="edit($index)" class="btn btn-default" title="Edit" ><span class="glyphicon glyphicon-edit"></span></button>
                        <button ng-click="remove($index)" class="btn btn-default" title="Delete" ><span class="glyphicon glyphicon-remove"></span></button>
                    </span>
                </td>
            </tr>
        </tbody>
    </table>
    <pagination ng-show="showPager" total-items="itemsCount" ng-model="paging.currentPage" max-size="paging.linksSize" class="pagination-sm" boundary-links="true" rotate="false" num-pages="numPages" items-per-page="paging.pageSize" ng-change="pageChanged()"></pagination>    
    @Html.Partial("Item/_TabularEdit")      
</script>